Part-83: đExpose a Pod with Google Kubernetes Engine Load balancer Service in GCP (Imperative way)
In this guide, weâll walk through how to expose a Pod in Google Kubernetes Engine (GKE) using a Kubernetes LoadBalancer Service. This will make your application accessible externally (from the internet) with a public IP address provided by GCP.
First, letâs create a Pod and then expose it with a LoadBalancer Service.
đ Create a Pod
# Template
kubectl run --image
# Example
kubectl run my-first-pod --image ghcr.io/stacksimplify/kubenginx:1.0.0
đ Expose the Pod as a Service
# Template
kubectl expose pod --type=LoadBalancer --port=80 --name=
# Example
kubectl expose pod my-first-pod --type=LoadBalancer --port=80 --name=my-first-service
đ Get Service Information
kubectl get service
kubectl get svc
Observations:
Initially, tâŠ
( 8
min )